package cn.itcast.dao;


import cn.itcast.domain.base.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

// 继承JpaSpecificationExecutor接口 复杂条件查询
public interface CourierRepository extends JpaRepository<Courier,Integer> ,JpaSpecificationExecutor<Courier> {

    @Query(value = "update Courier set deltag = '1' where id = ?1 " )
    @Modifying
    @Transactional
    void updateDelTag(Integer id);
    @Query(value = "update Courier set deltag = null  where id = ?1")
    @Modifying
    @Transactional
    void solBatch(Integer id);
}
